﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Tong;
public partial class aspnet_admin_bock_keyWord_Ask_LV_AddNew : System.Web.UI.Page
{
    TongUse TextData = new TongUse();

    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack)
        {
            tt.Text = "欢迎使用";
        }
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        if (ask_LV_name .Text != "" && ask_LV_name .Text.Length < 250 && TextData.SqlataSet("select ask_LV_name  from  [Ask_LV] where ask_LV_name ='" + ask_LV_name .Text.Trim() + "'").Tables[0].Rows.Count==0)
        {
            TextData.SqlDataSave("insert into [Ask_LV] (ask_LV_name, ask_Lv_cont,askuser_feng ) values('" + ask_LV_name.Text.Trim() + "','" + ask_Lv_cont.Text + "'," + askuser_feng.Text.Trim() + ")");
            tt.Text = "添加等级" + ask_LV_name .Text + "成功";
            GridView1.DataSourceID = "SqlDataSource1";
            GridView1.DataBind();
        }
        else
        {
            tt.Text = "输入的等级为空或超过250个或以存在相同等级";
            GridView1.DataSourceID = "SqlDataSource1";
            GridView1.DataBind();
        }
    }



}